package com.example.teamtribe.main.club.manage.applyactivity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.widget.TextView;

import com.example.teamtribe.R;
import com.example.teamtribe.base.BaseActivity;
import com.example.teamtribe.database.AcApply;
import com.example.teamtribe.database.Team;

import org.litepal.crud.DataSupport;

import java.util.ArrayList;

import butterknife.BindView;
import butterknife.OnClick;

public class AcAppListActivity extends BaseActivity {

    @BindView(R.id.rv_app_list)
    RecyclerView rvAppList;
    private Team team;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_ac_app_list);
        team = getIntent().getParcelableExtra("team");
        ((TextView) findViewById(R.id.tv_title)).setText("活动申请");
        rvAppList.setLayoutManager(new LinearLayoutManager(this));
        rvAppList.setAdapter(new AcAppAdapter(DataSupport.findAll(AcApply.class)));
    }

    @OnClick(R.id.fab_add)
    public void onViewClicked() {
        Intent intent = new Intent(this, ApplyActivityActivity.class);
        intent.putExtra("team", team);
        startActivity(intent);
    }
}
